- page_title "保护分支"

.row.prepend-top-default.append-bottom-default
  .col-lg-3
    %h4.prepend-top-0
      = page_title
    %p 保护稳定分支的安全并强制开发者使用合并请求功能
    %p.prepend-top-20
      默认情况下，保护分支被设计为：:
      %ul
        %li 禁止除了主程序员外，其他所有人员创建分支
        %li 禁止除了主程序员外，其他所有人员推送
        %li 禁止<strong>任何人</strong> 强制推送此分支
        %li 禁止<strong>任何人</strong> 删除此分支
      %p.append-bottom-0 点击 #{link_to "保护分支", help_page_path("user/project/protected_branches"), class: "underlined-link"} 和 #{link_to "项目权限", help_page_path("user/permissions"), class: "underlined-link"} 了解更多。
  .col-lg-9
    %h5.prepend-top-0
      保护分支
    - if can? current_user, :admin_project, @project
      = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch] do |f|
        = form_errors(@protected_branch)

        .form-group
          = f.label :name, "分支", class: "label-light"
          = render partial: "dropdown", locals: { f: f }
          %p.help-block
            支持 
            = link_to "通配符", help_page_path('user/project/protected_branches', anchor: "wildcard-protected-branches")
            例如
            %code *-stable
            或者
            %code production/*
            等形式。

        .form-group
          = f.check_box :developers_can_push, class: "pull-left"
          .prepend-left-20
            = f.label :developers_can_push, "开发者可推送", class: "label-light append-bottom-0"
            %p.light.append-bottom-0
              允许开发者推送到此分支

        .form-group
          = f.check_box :developers_can_merge, class: "pull-left"
          .prepend-left-20
            = f.label :developers_can_merge, "开发者可合并", class: "label-light append-bottom-0"
            %p.light.append-bottom-0
              允许开发者接受此分支的合并请求。
        = f.submit "保护", class: "btn-create btn protect-branch-btn", disabled: true

    %hr
    = render "branches_list"
